home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Control Panel 0.9.4 / TC 5 / SharedData.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-17  |  1.6 KB  |  50 lines  |  [TEXT/KAHL]

  1. /*
  2.     SharedData.h
  3.     
  4.     Data structure shared by the extension and the patch code.
  5. */
  6.  
  7. /* This is a struct that the shared data holds a handle to */
  8.  
  9. typedef struct {
  10.     Boolean        On;            /* Is the extension "on" or "off"? */
  11.     Boolean        ShowIcon;    /* Show icon at startup? */
  12. } CPprefsStruct, *CPprefsPtr, **CPprefsHandle;
  13.  
  14. /* This is the actual shared data structure */
  15.  
  16. typedef struct {
  17.  
  18.     Boolean        inUse;            /* This should be set to true when a piece of code */
  19.                                 /* is using the data structure, then back to false */
  20.                                 /* when it's through.  Each piece of code that     */
  21.                                 /* accesses the structure should wait until the    */
  22.                                 /* flag is false before using the data structure.  */
  23.  
  24.     /* Variables used by the Trap Patch */
  25.     
  26.     long        oldTrap;        /* location of old trap routine (before our patch) */
  27.     long        paramBytes;        /* how many bytes taken up by parameters */
  28.     long        returnBytes;    /* how many bytes taken by return value (can be 0) */
  29.     
  30.     /* Variables used by the Extension and Control Panel */
  31.     
  32.     Boolean        patched;        /* was the patch installed? */
  33.     
  34.     /* Variables used by the Control Panel */
  35.     
  36.     DialogPtr    CPdialogPtr;    /* a pointer to the control panel dialog */
  37.     short        CPitems;        /* number of items in the dialog */
  38.     CPprefsHandle    CPprefsRsrc;    /* handle to a prefs struct (saved as a resource) */
  39.     Boolean        CPon;            /* is the control panel function on or off? */
  40.     
  41.     /* Memory used for notifications */
  42.     
  43.     NMRec            nm;                /* a pointer to a Notification Manager record */
  44.     Str255            str;            /* a Pascal string */
  45.     
  46.     /* Whatever other variables we need to share */
  47.     
  48.         
  49. } myDataStruct, *myDataPtr, **myDataHandle;
  50.